#include "tinyrpc/net/timerque.h"
#include "tinyrpc/net/eventloop.h"
#include <iostream>
#include "tinyrpc/base/task.h"
#include "tinyrpc/base/thread.h"
#include "tinyrpc/net/coroutine_function.h"
using namespace TinyRPC;

// coroutine_sleep 一定要写到协程里面
void timetask1(){
    
    coroutine_sleep(3);
    std::cout<<"timer 1" <<std::endl;
    
    
}

void timetask2(){
    std::cout<<"timer 2" <<std::endl;
}
int main(){
    
    EventLoop eventLoop;
    Thread thread1([&](){
        eventLoop.runInLoop(Task(timetask1, true));
    });
    thread1.start();
    eventLoop.loop();

    
    
    
}